package com.example.liteflow.controller;

import com.example.liteflow.service.FlowService;
import com.example.liteflow.service.LiteFlowService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * LiteFlow规则引擎控制器
 *
 * @author haijin
 * @since 2024-01-01
 */
@Slf4j
@RestController
@RequestMapping("/liteflow")
@RequiredArgsConstructor
@Tag(name = "LiteFlow动态脚本测试", description = "LiteFlow动态脚本测试相关接口")
public class FlowController {

    private final FlowService flowService;

    @GetMapping("/test")
    @Operation(summary = "测试动态脚本", description = "测试动态脚本")
    public ResponseEntity<String> exec() throws Exception  {
        String exec = flowService.exec();
        return ResponseEntity.ok(exec);
    }

}
